import {Component, OnInit} from '@angular/core';
import {ControlUIWidget, SFCustomWidgetSchema} from '@delon/form';


export interface FieldSetSchema extends SFCustomWidgetSchema {
    marginLeft?: string;
}

@Component({
    // tslint:disable-next-line:component-selector
    selector: 'field-set-alain',
    templateUrl: './field-set-alain.component.html',
    styleUrls: ['./field-set-alain.component.less']
})
export class FieldSetAlainComponent extends ControlUIWidget<FieldSetSchema> implements OnInit {
    /* 用于注册小部件 KEY 值 */
    static readonly KEY = 'field-set-alain';

    selectedValue: any;
    marginLeft: string | number = 0;

    ngOnInit(): void {
        this.marginLeft = this.ui.marginLeft;
    }

    reset(_value: any): void {
        this.selectedValue = _value;
    }


    setValue(value: string): void {
        super.setValue(value);
        if (this.ui.valueChange) {
            this.ui.valueChange(value);
        }
    }
}
